package com.googlecode.guicehibernate.event.def;

import java.util.Date;

import org.hibernate.event.SaveOrUpdateEvent;
import org.hibernate.event.def.DefaultUpdateEventListener;

import com.googlecode.guicehibernate.UpdatedAt;

public class TimeSettingUpdateEventListener extends DefaultUpdateEventListener {

	private static final long serialVersionUID = 1625866184508236335L;

	@Override
	public void onSaveOrUpdate(SaveOrUpdateEvent event) {
		Object object = event.getObject();
		Times.setTime(object, UpdatedAt.class, new Date());
		super.onSaveOrUpdate(event);
	}
	
	
	
	
}
